#ifndef ACCEPTOR_H
#define ACCEPTOR_H

#include "Socket.h"
#include "InetAddress.h"
#include "TcpConnect.h"
#include <iostream>
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>

using std::cout;
using std::endl;

class Acceptor
{
private:
    Socket _sock;
    InetAddress _inet;

public:
    Acceptor(const char *ip, unsigned short port);
    ~Acceptor();
    int fd() const;
    void init();
    void setReuseIp();
    void setReusePort();
    void bind();
    void listen();
    int accept();
};

#endif